let input = document.getElementById('input')

let obj = {
    name: "lll"
}
// 实现双向绑定
Object.defineProperties(obj, "name", {
    set(val) {
        input.value = val
    }
})
obj.name = "cc"

// proxy
const handler = {
    set(target, key, val) {
        input.value = val;
        return Reflect.set(target, key, value)
    }
}

let proxy = new Proxy(obj, handler)
proxy.name = "cc"